Don't crash when the properties window is destroyed.
authorAlex Larsson <alexl@redhat.com>
Tue, 5 Jun 2001 21:48:24 +0000 (21:48 +0000)
committerAlexander Larsson <alexl@src.gnome.org>
Tue, 5 Jun 2001 21:48:24 +0000 (21:48 +0000)
2001-06-05  Alex Larsson  <alexl@redhat.com>

* tests/testgtk.c (destroy_properties):
Don't crash when the properties window is destroyed.

* gtk/gtkimagemenuitem.c (gtk_image_menu_item_new_from_stock):
Use with_mnemonics to handle the case of stock items with
underscores in them.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkimagemenuitem.c
tests/testgtk.c

index 1244218b5bf80776b1286dd9fbbb54a2dc6fe834..dcc9e957ca942e04520d651eb4befb81c6a0137e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-06-05  Alex Larsson  <alexl@redhat.com>
+
+       * tests/testgtk.c (destroy_properties):
+       Don't crash when the properties window is destroyed.
+
+       * gtk/gtkimagemenuitem.c (gtk_image_menu_item_new_from_stock):
+       Use with_mnemonics to handle the case of stock items with
+       underscores in them.
+
 2001-06-05  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextiter.c (gtk_text_iter_order): rename from 
index 1244218b5bf80776b1286dd9fbbb54a2dc6fe834..dcc9e957ca942e04520d651eb4befb81c6a0137e 100644 (file)
@@ -1,3 +1,12 @@
+2001-06-05  Alex Larsson  <alexl@redhat.com>
+
+       * tests/testgtk.c (destroy_properties):
+       Don't crash when the properties window is destroyed.
+
+       * gtk/gtkimagemenuitem.c (gtk_image_menu_item_new_from_stock):
+       Use with_mnemonics to handle the case of stock items with
+       underscores in them.
+
 2001-06-05  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextiter.c (gtk_text_iter_order): rename from 
index 1244218b5bf80776b1286dd9fbbb54a2dc6fe834..dcc9e957ca942e04520d651eb4befb81c6a0137e 100644 (file)
@@ -1,3 +1,12 @@
+2001-06-05  Alex Larsson  <alexl@redhat.com>
+
+       * tests/testgtk.c (destroy_properties):
+       Don't crash when the properties window is destroyed.
+
+       * gtk/gtkimagemenuitem.c (gtk_image_menu_item_new_from_stock):
+       Use with_mnemonics to handle the case of stock items with
+       underscores in them.
+
 2001-06-05  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextiter.c (gtk_text_iter_order): rename from 
index 1244218b5bf80776b1286dd9fbbb54a2dc6fe834..dcc9e957ca942e04520d651eb4befb81c6a0137e 100644 (file)
@@ -1,3 +1,12 @@
+2001-06-05  Alex Larsson  <alexl@redhat.com>
+
+       * tests/testgtk.c (destroy_properties):
+       Don't crash when the properties window is destroyed.
+
+       * gtk/gtkimagemenuitem.c (gtk_image_menu_item_new_from_stock):
+       Use with_mnemonics to handle the case of stock items with
+       underscores in them.
+
 2001-06-05  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextiter.c (gtk_text_iter_order): rename from 
index 1244218b5bf80776b1286dd9fbbb54a2dc6fe834..dcc9e957ca942e04520d651eb4befb81c6a0137e 100644 (file)
@@ -1,3 +1,12 @@
+2001-06-05  Alex Larsson  <alexl@redhat.com>
+
+       * tests/testgtk.c (destroy_properties):
+       Don't crash when the properties window is destroyed.
+
+       * gtk/gtkimagemenuitem.c (gtk_image_menu_item_new_from_stock):
+       Use with_mnemonics to handle the case of stock items with
+       underscores in them.
+
 2001-06-05  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextiter.c (gtk_text_iter_order): rename from 
index 1244218b5bf80776b1286dd9fbbb54a2dc6fe834..dcc9e957ca942e04520d651eb4befb81c6a0137e 100644 (file)
@@ -1,3 +1,12 @@
+2001-06-05  Alex Larsson  <alexl@redhat.com>
+
+       * tests/testgtk.c (destroy_properties):
+       Don't crash when the properties window is destroyed.
+
+       * gtk/gtkimagemenuitem.c (gtk_image_menu_item_new_from_stock):
+       Use with_mnemonics to handle the case of stock items with
+       underscores in them.
+
 2001-06-05  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextiter.c (gtk_text_iter_order): rename from 
index 1244218b5bf80776b1286dd9fbbb54a2dc6fe834..dcc9e957ca942e04520d651eb4befb81c6a0137e 100644 (file)
@@ -1,3 +1,12 @@
+2001-06-05  Alex Larsson  <alexl@redhat.com>
+
+       * tests/testgtk.c (destroy_properties):
+       Don't crash when the properties window is destroyed.
+
+       * gtk/gtkimagemenuitem.c (gtk_image_menu_item_new_from_stock):
+       Use with_mnemonics to handle the case of stock items with
+       underscores in them.
+
 2001-06-05  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextiter.c (gtk_text_iter_order): rename from 
index 68c020407f3579789a4c2a2618314f5b9390c7f0..cd74909a7309c5cd7716261adde29f726f69931a 100644 (file)
@@ -399,7 +399,7 @@ gtk_image_menu_item_new_from_stock (const gchar      *stock_id,
 
   if (gtk_stock_lookup (stock_id, &stock_item))
     {
-      item = gtk_image_menu_item_new_with_label (stock_item.label);
+      item = gtk_image_menu_item_new_with_mnemonic (stock_item.label);
 
       gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
       
index 5f3611f1ac8d0c554009947b44e282565e505fde..e6042b54c3f263d01a9542ed70f6606f50bd7e01 100644 (file)
@@ -9265,15 +9265,26 @@ struct PropertiesData {
 };
 
 static void
-destroy_properties (GtkWidget  *widget,
+destroy_properties (GtkWidget             *widget,
                    struct PropertiesData *data)
 {
-  *data->window = NULL;
+  if (data->window)
+    {
+      *data->window = NULL;
+      data->window = NULL;
+    }
 
   if (data->cursor)
-    gdk_cursor_destroy (data->cursor);
-    
-  gtk_signal_disconnect (widget, data->handler);
+    {
+      gdk_cursor_destroy (data->cursor);
+      data->cursor = NULL;
+    }
+
+  if (data->handler)
+    {
+      gtk_signal_disconnect (widget, data->handler);
+      data->handler = 0;
+    }
 
   g_free (data);
 }
@@ -9345,9 +9356,9 @@ create_properties (void)
     {
       window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 
-      data->handler = gtk_signal_connect_object (GTK_OBJECT (window), "destroy",
-                                                GTK_SIGNAL_FUNC(destroy_properties),
-                                                data);
+      data->handler = gtk_signal_connect (GTK_OBJECT (window), "destroy",
+                                         GTK_SIGNAL_FUNC(destroy_properties),
+                                         data);
 
       gtk_window_set_title (GTK_WINDOW (window), "test properties");
       gtk_container_set_border_width (GTK_CONTAINER (window), 10);
@@ -10761,6 +10772,5 @@ main (int argc, char *argv[])
        g_main_iteration (FALSE);
 #endif
     }
-
   return 0;
 }